Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell script to run kibana tests on cloud via Jenkins #21107

Merged
merged 2 commits into from
Jul 23, 2018

Conversation

liza-mae
Copy link
Contributor

@liza-mae liza-mae commented Jul 23, 2018

Shell script to setup and run kibana test on cloud.

Addresses issue #19229

@spalger
Copy link
Contributor

spalger commented Jul 23, 2018

I'm confused, how does this know to run things on cloud?

@liza-mae
Copy link
Contributor Author

Hi @spalger it knows to run them on cloud by setting the following env variables, which I plan do as part of elastic-stack-testing framework after provisioning the cloud instance.

export TEST_KIBANA_HOSTNAME=
export TEST_KIBANA_PROTOCOL=
export TEST_KIBANA_PORT=
export TEST_KIBANA_USER=
export TEST_KIBANA_PASS=

export TEST_ES_HOSTNAME=
export TEST_ES_PROTOCOL=
export TEST_ES_PORT=
export TEST_ES_USER=
export TEST_ES_PASS=

@spalger
Copy link
Contributor

spalger commented Jul 23, 2018

Is that something that will happen in this script?

@liza-mae
Copy link
Contributor Author

I am not sure I understand your question, but if you are asking if this script is modified by the elastic-stack-framework, it is not. I will just set the env variables listed and then run this script as is.

@spalger
Copy link
Contributor

spalger commented Jul 23, 2018

I guess I was confused why the script doesn't include the setup necessary to run on cloud, but is described as the "script to run kibana tests on cloud via Jenkins". I guess it's more a script to run the kibana tests that are compatible with cloud.

Would you mind including a comment at the top of this script that explains the dependency this script has on the elastic-stack-testing framework to setup the cloud environment for testing, and that the script will be called with the necessary environment variables preset to run against a cloud env?


Alternatively, how would you feel about this script being responsible for setting up the elastic-stack-testing framework? Then I think this script really would be the script that runs the Kibana tests on cloud. Then it would also be more obvious to people looking at this script what steps are necessary to actually run the tests on cloud. I imagine it looking something like this:

#!/usr/bin/env bash
 
set -e

# resolve the path to the root of the Kibana repo
kibanaPath="$(cd "$(dirname $0)/../.."; pwd)"

# check and resolve the path to the root of the elastic-stack-testing repo
git clone [email protected]:elastic/elastic-stack-testing.git "$kibanaPath/../elastic-stack-testing"
estPath="$(cd "$kibanaPath/../elastic-stack-testing"; pwd)"

# setup node/yarn and bootstrap the Kibana repo
source "$kibanaPath/src/dev/ci_setup/setup.sh"

# run the elastic-stack-testing jenkins_build_cloud.sh script with the tests we want to run
"$estPath/jenkins_build_cloud.sh" "xvfb-run node scripts/functional_test_runner --debug --grep @skipcloud --invert"

I imagine it won't work exactly like this, but if it worked sort of like this then this scripts reliance to the elastic-stack-testing repo are very clear to anyone trying to understand what we do to run our tests on cloud.

@liza-mae
Copy link
Contributor Author

@spalger yes it's basically to just run kibana tests compatible with cloud, so it makes sense for me to add a comment explaining that for now.

On your alternative approach, I am open to exploring other ways. It would be best to setup some discussion time though instead of writing in comments here and trying to explain it all, if that is cool with you :)

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Happy to discuss the alternative approach sometime if you want to set something up :)

@elasticmachine
Copy link
Contributor

💔 Build Failed

@liza-mae
Copy link
Contributor Author

Awesome Spencer, thanks I will set something up.

@liza-mae
Copy link
Contributor Author

CI failure is unrelated to changes in this PR.

@liza-mae liza-mae merged commit 94ac3c5 into elastic:master Jul 23, 2018
@liza-mae liza-mae deleted the fix/issue-19229 branch July 23, 2018 23:54
liza-mae added a commit to liza-mae/kibana that referenced this pull request Jul 23, 2018
* Shell script to run kibana tests on cloud via Jenkins

* Add comment explaining cloud setup
liza-mae added a commit to liza-mae/kibana that referenced this pull request Jul 23, 2018
* Shell script to run kibana tests on cloud via Jenkins

* Add comment explaining cloud setup
liza-mae added a commit that referenced this pull request Jul 24, 2018
* Shell script to run kibana tests on cloud via Jenkins

* Add comment explaining cloud setup
liza-mae added a commit that referenced this pull request Jul 24, 2018
* Shell script to run kibana tests on cloud via Jenkins

* Add comment explaining cloud setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants